@echo off
rem This is an infinite loop, and it just keeps going as long as it starts executing.
setlocal

rem Log output from the command.
set COMMAND_OUTPUT="C:\My Scripts\Logs\TerminateQAX.log"

:infiniteLoop
rem ---------- The following commands will be executed in an infinite loop. ----------

rem Record the start time of command execution.
set EXECUTION_TIME=%date% %time%
echo Command execution time: %EXECUTION_TIME% >> %COMMAND_OUTPUT%

rem Record the executed commands and the output of the executed commands.

echo taskkill /F /IM qaxdefender.exe >> %COMMAND_OUTPUT%
taskkill /F /IM qaxdefender.exe >> %COMMAND_OUTPUT% 2>&1

echo taskkill /F /IM QaxEngManager.exe >> %COMMAND_OUTPUT%
taskkill /F /IM QaxEngManager.exe >> %COMMAND_OUTPUT% 2>&1

rem Pause for a moment to prevent the script from taking up too much CPU time.
timeout /T 1 /NOBREAK > nul 2>> %COMMAND_OUTPUT%

rem ---------- The definition of an infinite loop ends here. ----------
goto infiniteLoop
